<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>

<html>
<head>
    <s:set name="isNew" value="id == null"/>
    <s:set var="title">
        <s:if test="#isNew">创建</s:if><s:else>修改</s:else>工作计划
    </s:set>

    <title><s:property value="#title"/></title>

    <script type="text/javascript">
        $(document).ready(function () {
            $("#inputForm").validate({
                                         rules:{
                                             planName:{
                                                 required:true
                                             },
                                             planTarget:{
                                                 required:true
                                             },
                                             planStep:{
                                                 required:true
                                             },
                                             expectTime:{
                                                 required:true,
                                                 customDate:true
                                             }
                                         }
                                     })
        });

        function submitForm() {
            $('#inputForm').submit();
        }

        function submitAndInput() {
            $('#inputForm').attr("action","workplan!saveAndInput.action") ;
            $('#inputForm').submit();
        }
    </script>
    <meta name="menu" content="myWorkplan"/>
</head>

<body>

<div class="content_block">
    <h2 class="jquery_tab_title"><s:property value="#title"/></h2>

    <form id="inputForm" action="workplan!save.action" method="post">
        <input type="hidden" name="revision" value="${revision}"/>
        <input type="hidden" name="id" value="${id}"/>

        <p>
            <label for="planName">计划名: </label>
            <input name="planName" id="planName" type="text" value="${planName}" class="input-flex"/>
        </p>

        <p>
            <label for="planTarget">工作计划目标:</label>
            <textarea name="planTarget" id="planTarget" cols="40" rows="3">${planTarget}</textarea>
        </p>

        <p>
            <label for="planStep">工作计划步骤: </label>
            <textarea name="planStep" id="planStep" cols="40" rows="3">${planStep}</textarea>
        </p>

        <p>
            <label for="planSummary">工作计划总结: </label>
            <textarea name="planSummary" id="planSummary" cols="40" rows="3">${planSummary}</textarea>
        </p>

        <p>
            <label for="expectTime">预计完成时间：</label>
            <input class="input-small flexy_datepicker_input" type="text" name="expectTime" id="expectTime"
                   value="<s:date name='expectTime' format="yyyy-MM-dd"/>">
            <%--value="<fmt:formatDate value=' ${expectTime}' pattern='YYYY-MM-dd'/>"--%>
        </p>


        <p>
            <label for="status">状态：</label>
            <code:dispCodeList codeType="PLAN_STATUS" id= "status" name="status" codeValue="${status}" />
        </p>
        <p>
            <a class="button" href="javascript:submitForm();"><span>保存</span></a>
            <a class="button" href="javascript:submitAndInput();"><span>保存并添加</span></a>
            <a class="button" onclick="javascript:history.back()"><span>返回</span></a>
        </p>

    </form>
</div>
</body>
</html>
